<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Redirect extends CI_Controller {
	public function index()
	{	
		
		$this->load->model('Suburl_ml');
		$data=$this->uri->segment(1);
		$url=$this->Suburl_ml->getporpouseUrl($_SERVER['SERVER_NAME'],$data);
		if(stristr($url,"http://"))
		{
			//exit($url);
			redirect($url);
		}
		else 
		{
			if(strlen($url)>0){
				redirect("http://".$url);
			}else 
			{
				echo "未查到要访问的网址";
				redirect(base_url());
			}
		}
		
		//$this->load->helper('url');	//autoload中加载
		//$this->load->view('welcome_message1');
	}
	function error1()
	{
		$this->load->view('error1');
		$this->output->enable_profiler(true);		
	}
}

/* End of file redirect.php */
/* Location: ./application/controllers/redirect.php */